// 创建网格模型
// 创建纹理加载器
// TextureLoader创建一个纹理加载器对象，可以加载图片作为几何体纹理
import * as THREE from "three";
import {link} from "@/config/config.js";


function addGeoMetry(textureImg, radius, x) {
    var texLoader = new THREE.TextureLoader();
    var texture = texLoader.load(link + textureImg)
    var material = new THREE.MeshBasicMaterial({
        map: texture,
    }); //材质对象Material
    var geometry = new THREE.SphereGeometry(radius, 25, 25);
    var mesh = new THREE.Mesh(geometry, material); //网格模型对象Mesh
    mesh.position.x = x
    return mesh
}

export default addGeoMetry
